home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 91 < prev    next >
Internet Message Format  |  1996-08-06  |  1KB

  1. Path: stdc.demon.co.uk!clive
  2. From: clive@stdc.demon.co.uk (Clive D.W. Feather)
  3. Newsgroups: comp.std.c
  4. Subject: Re: int's and zero
  5. Date: Fri, 12 Jan 1996 18:35:02 GMT
  6. Organization: Demon Internet Limited (personal account)
  7. Message-ID: <DL2zMG.Dpn@stdc.demon.co.uk>
  8. References: <4cth4e$4q@odin.funcom.no> <4cub1a$jbl@alterdial.UU.NET> <4d0kd3$d8l@sam.inforamp.net> <DL0CII.F9A@ukpsshp1.serigate.philips.nl>
  9. Reply-To: clive@demon.net
  10. X-NNTP-Posting-Host: stdc.demon.co.uk
  11.  
  12. In article <DL0CII.F9A@ukpsshp1.serigate.philips.nl>,
  13. Stephen Baynes <baynes@ukpsshp1.serigate.philips.nl> wrote:
  14. > Also (under as-if) the bits one sees probably only have to look like binary
  15. > to operations such as & and <<. For example I think it is possible to
  16. > do something like invert the bits as you read/write memory. Consider this
  17. > perverse implementation:
  18. >     char - normal binary encoding
  19. >     int - binary encoding except that bits are inverted when reading/writing
  20. >         memory.
  21. > Thus binary 0000 written as char will look like binary 1111 when read as int.
  22. > So 'memset( &i, 0, sizeof(int) )' will not set int 'i' to 0.
  23.  
  24. As I interpret the ruling (DR069), this is not permitted.
  25.  
  26. > P.S. Was there ever a final ruling over whether UINT_MAX had to be of the
  27. > form 2^n-1 ?
  28.  
  29. Yes, it does.
  30.  
  31. -- 
  32. Clive D.W. Feather                       | If you lie to the compiler,
  33. clive@demon.net        (work, preferred) | it will get its revenge.
  34. clive@stdc.demon.co.uk (home)            |   - Henry Spencer
  35.